<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h2>双大括号表达式</h2>
        <p>{{msg}}</p>
        <p>{{msg.toUpperCase()}}</p>
        <!--  会将它理解成一个标签 -->
        <p v-html='msg'></p>
        <!-- 理解成文本 -->
        <p v-text='msg'></p>
        <h2>强行数据绑定</h2>
        <!-- <img v-bind:src="imgurl" alt=""> -->
        <img :src="imgurl" alt="">
        <h2>绑定事件监听</h2>
        <button v-on:click="test">test1</button>
        <button @click="test(1,2)">test1</button>
        <button @click="test2(msg)">test1</button>
    </div>
    <script src="./vue.min.js"></script>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                msg: '<a href="http://www.baidu.com">123</a>',
                imgurl: 'https://cn.vuejs.org/images/logo.png'
            },
            methods: {
                test(a, b) {
                    console.log(arguments);
                },
                test2(a) {
                    console.log(a);
                }
            }
        })
    </script>
</body>

</html>